import React, { useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Link, useHistory } from 'react-router-dom'
import { Layout, Menu, Breadcrumb, Row, Col, Button, Tabs, Space, message } from 'antd';
import { UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons';
import { checkLogin } from '../../utils/loginUtils/loginMethod'
import UserCenter from './userCenter'
export default () => {
    const history = useHistory()
    if (!checkLogin()) {
        message.error('请登录')
        history.push('/user')
    }

    const fullScreen = () => {
        if (document.documentElement.RequestFullScreen) {
            document.documentElement.RequestFullScreen();
        }
        //兼容火狐
        console.log(document.documentElement.mozRequestFullScreen)
        if (document.documentElement.mozRequestFullScreen) {
            document.documentElement.mozRequestFullScreen();
        }
        //兼容谷歌等可以webkitRequestFullScreen也可以webkitRequestFullscreen
        if (document.documentElement.webkitRequestFullScreen) {
            document.documentElement.webkitRequestFullScreen();
        }
        //兼容IE,只能写msRequestFullscreen
        if (document.documentElement.msRequestFullscreen) {
            document.documentElement.msRequestFullscreen();
        }
    }
    const notFullScreen = () => {
        if (document.exitFullScreen) {
            document.exitFullscreen()
        }
        //兼容火狐
        console.log(document.mozExitFullScreen)
        if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen()
        }
        //兼容谷歌等
        if (document.webkitExitFullscreen) {
            document.webkitExitFullscreen()
        }
        //兼容IE
        if (document.msExitFullscreen) {
            document.msExitFullscreen()
        }
    }

    //页面加载时全屏
    useEffect(() => {
        notFullScreen();
    }, [])

    return (
        <UserCenter/>
    )
}


